{extend name="index/base" /}
{block name='content'}

<div id="mainWrap">
    <div class="container">
        <div class="articleWrap py-5">
            <div class="input-group flex-nowrap" >
                Enter Your Tracking Number To See The Tracking Details
            </div>
            <div class="input-group flex-nowrap" >
                <input class="form-control " name="EMAIL" v-model="num" placeholder="Your email" />
                <button class="btn btn-warning" type="button" name="subscribe" @click="doTrack()">SUBSCRIBE</button>
            </div>
            <!--用于显示查询结果的容器。-->
            <div id="YQContainer"></div>
        </div>
    </div>
</div>

{/block}
{block name='script'}
<!-- Vendor scrits: js libraries and plugins-->
<script src="/assets/js/bootstrap.bundle.min.js"></script>
<script src="/assets/js/smooth-scroll.polyfills.min.js"></script>

<!--脚本代码可放于页面底部，等到页面最后执行。-->
<script type="text/javascript" src="//www.17track.net/externalcall.js"></script>
<script>

	layui.extend({
	}).use([], function () {
		initVue({
			data: {
                num:"{:input('num')}",
			},
			components: {

			},
			computed: {

			},
			created: function () {

			},
			mounted: function () {
                if(this.num){
                    this.doTrack()
                }
			},
			methods: {
                doTrack:function () {
                    if(this.num===""){
                        this.$message.error("Enter your number.")
                        return;
                    }
                    YQV5.trackSingle({
                        //必须，指定承载内容的容器ID。
                        YQ_ContainerId:"YQContainer",
                        //可选，指定查询结果高度，最大为800px，默认为560px。
                        YQ_Height:560,
                        //可选，指定运输商，默认为自动识别。
                        YQ_Fc:"0",
                        //可选，指定UI语言，默认根据浏览器自动识别。
                        YQ_Lang:"en",
                        //必须，指定要查询的单号。
                        YQ_Num:this.num
                    });
                }
			},
		})


	})

</script>
{/block}